﻿using IM.Easy.Core.SeedData;
using IM.Easy.Entity.System;
using SqlSugar;

namespace IM.Easy.Api.SeedData
{
    public class DictTypeSeedData : MemorySeedData<SysDictType>
    {
        public override int Execute(SqlSugarScope db)
        {
            var data = Read();
            var count = 0;
            if (data.Count > 0)
                count = db.Insertable(data).ExecuteReturnSnowflakeIdList().Count;
            return count;
        }
        public override List<SysDictType> Read()
        {
            List<SysDictType> list = [];

            list.Add(new SysDictType { Code = "sys_data_type", Name = "值类型", DataType = ValueDataType.Number, IsSystem = true });
            list.Add(new SysDictType { Code = "sys_normal_disable", Name = "启用状态", DataType = ValueDataType.Boolean, IsSystem = true });
            list.Add(new SysDictType { Code = "code_lang", Name = "语言类型", DataType = ValueDataType.String });
            list.Add(new SysDictType { Code = "sys_yes_no", Name = "布尔是否", DataType = ValueDataType.Boolean });
            list.Add(new SysDictType { Code = "sys_show_hide", Name = "显示开关", DataType = ValueDataType.Boolean });
            list.Add(new SysDictType { Code = "log_error_type", Name = "异常类型", DataType = ValueDataType.Number });
            list.Add(new SysDictType { Code = "sys_login_terminal", Name = "登录终端", DataType = ValueDataType.Number });
            list.Add(new SysDictType { Code = "gen_func", Name = "生成功能", DataType = ValueDataType.String });
            list.Add(new SysDictType { Code = "sys_notice_status", Name = "公告发布状态", DataType = ValueDataType.Number });
            list.Add(new SysDictType { Code = "sys_notice_effective", Name = "公告生效状态", DataType = ValueDataType.Number });
            list.Add(new SysDictType { Code = "sys_priority", Name = "优先级", DataType = ValueDataType.Number });
            list.Add(new SysDictType { Code = "external_platform", Name = "三方平台", DataType = ValueDataType.String });
            list.Add(new SysDictType { Code = "user_creation_source", Name = "创建用户方式", DataType = ValueDataType.String });
            list.Add(new SysDictType { Code = "sys_user_sex", Name = "性别", DataType = ValueDataType.Number });
            list.Add(new SysDictType { Code = "sys_result", Name = "结果状态", DataType = ValueDataType.Boolean });
            return list;
        }
    }
}
